import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'index',
      component: () => import("../views/Index.vue")// 网站首页
    },
    {
      path: '/login',
      name: 'login',
      component: () => import("../views/Login.vue")// 网站登录页
    },
    {
      path: '/register',
      name: 'register',
      component: () => import("../views/Register.vue")// 网站注册页
    },
    {
      path: '/forgotPassword',
      name: 'forgotPassword',
      component: () => import("../views/ForgotPassword.vue") // 网站忘记密码页
    },
    {
      path: '/dataView',
      name: 'dataView',
      component: () => import("../components/Public/DataViews.vue"), //数据大屏,
    },
    {
      path: '/system',
      name: 'system',
      component: () => import("../views/System.vue"),// 系统页面
      redirect: '/dataView',
      children: [
          // 身份为超级管理员/管理员
        {
          path: '/announcement',
          name: 'announcement',
          component: () => import("../components/Public/AnnouncementManagement.vue") //发布公告
        },
        {
          path: '/complaint',
          name: 'complaint',
          component: () => import("../components/Public/ComplaintManagement.vue") //投诉管理
        },
        {
          path: '/orderData',
          name: 'orderData',
          component: () => import("../components/Public/OrderData.vue") //订单数据
        },
        {
          path: '/adminReview',
          name: 'adminReview',
          component: () => import("../components/Public/AdminReview.vue") //管理员审核
        },
        {
          path: '/adminManagement',
          name: 'adminManagement',
          component: () => import("../components/Public/AdminManagement.vue") //管理员管理
        },
        {
          path: '/sellerReview',
          name: 'sellerReview',
          component: () => import("../components/Public/SellerReview.vue") //商家审核
        },
        {
          path: '/business',
          name: 'business',
          component: () => import("../components/Public/BusinessManagement.vue") //商家管理
        },
        {
          path: '/customerManagement',
          name: 'customerManagement',
          component: () => import("../components/Public/CustomerManagement.vue") //顾客管理
        },
        {
          path: '/adminSelf',
          name: 'adminSelf',
          component: () => import("../components/admin/AdminSelf.vue") //账号管理
        },
        // 身份为商家
        {
          path: '/myShop',
          name: 'myShop',
          component: () => import("../components/seller/MyShop.vue") //我的店铺
        },
        {
          path: '/product',
          name: 'product',
          component: () => import("../components/seller/ProductManagement.vue") //商品管理
        },
        {
          path: '/customer',
          name: 'customer',
          component: () => import("../components/seller/CustomerManagement.vue") //顾客管理
        },
        {
          path: '/orderCenter',
          name: 'orderCenter',
          component: () => import("../components/seller/OrderCenter.vue") //订单中心
        },
        {
          path: '/sellerSelf',
          name: 'sellerSelf',
          component: () => import("../components/seller/SellerSelf.vue") //账号管理
        },
          // 身份为顾客
        {
          path: '/shops',
          name: 'shops',
          component: () => import("../components/buyer/Shops.vue") //店铺列表
        },
        {
          path: '/shoppingCart',
          name: 'shoppingCart',
          component: () => import("../components/buyer/ShoppingCart.vue") //购物车
        },
        {
          path: '/myOrder',
          name: 'myOrder',
          component: () => import("../components/buyer/MyOrder.vue") //我的订单
        },
        {
          path: '/buyerSelf',
          name: 'buyerSelf',
          component: () => import("../components/buyer/BuyerSelf.vue") //账号管理
        },
        {
          path: '/systemIndex',
          name: 'systemIndex',
          component: () => import("../components/Public/SystemIndex.vue") //系统进入展示首页面
        },
      ]
    },
  ],
})
export default router
